﻿﻿using System;
using System.Collections.Generic;
using System.Text;
namespace WebApplication1.DDD.Models.Entity.Common
{
    public class shop_goods:NFinal.Struct
    {
		public System.Int64 id;
		public System.String subject;
		public System.Double? fee;
		public System.Int64? qty;
		public System.String body;
		public System.String show_url;
		public System.String total_fee;
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out shop_goods par)
		{
			par=new shop_goods();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.subject=get["subject"];
						par.fee=null;
						if(get["fee"]!=null)
						{
							par.fee=System.Double.Parse(get["fee"]);
						}
						par.qty=null;
						if(get["qty"]!=null)
						{
							par.qty=System.Int64.Parse(get["qty"]);
						}
						par.body=get["body"];
						par.show_url=get["show_url"];
						par.total_fee=get["total_fee"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public override void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"subject\":");
					tw.Write("\"");
					tw.Write(subject==null?"null":subject);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"fee\":");
					tw.Write(fee==null?"null" : fee.ToString());
					tw.Write(",");
					tw.Write("\"qty\":");
					tw.Write(qty==null?"null" : qty.ToString());
					tw.Write(",");
					tw.Write("\"body\":");
					tw.Write("\"");
					tw.Write(body==null?"null":body);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"show_url\":");
					tw.Write("\"");
					tw.Write(show_url==null?"null":show_url);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"total_fee\":");
					tw.Write("\"");
					tw.Write(total_fee==null?"null":total_fee);
					tw.Write("\"");
			tw.Write("}");
		}
		#endregion
    }
}
